package com.ming.springboot.util;

import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;

/**
 * Created by mqsi on 2022/5/9 10:13
 */
@Configuration
@PropertySource(value = "classpath:student.properties", ignoreResourceNotFound = true)
public class PropertiesHelper implements EnvironmentAware {
	private static Environment environment;
	@Override
	public void setEnvironment(Environment environment) {
		this.environment = environment;
	}

	public static String getProperties(String key){
		return environment.getProperty(key);
	}
}
